<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
<style type="text/css">
	body{
        margin:0;padding:0;border:0;width:100%;height:100%;overflow:hidden;
    }
</style>
</head>
<body>
	<div class="mini-toolbar" style="text-align:center;line-height:30px;" borderStyle="border:0;">
          <label >手机号：</label>
          <input id="phoneNum" class="mini-textbox" style="width:140px;" emptyText="请输入完整的电话号码" onenter="onKeyEnter"/>
          <label >姓名：</label>
          <input id="name" class="mini-textbox" style="width:100px;" emptyText="请输入姓名" onenter="onKeyEnter"/>
          <a class="mini-button" style="width:60px;" onclick="search()">查询</a>
    </div>
    <div class="mini-fit">
    	<input id="customer_id" class="mini-hidden" />
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" idField="id" allowResize="false"
            borderStyle="border-left:0;border-right:0;" onrowdblclick="onRowDblClick" url="customer_manage_find_rec.do">
            <div property="columns">
                <div type="indexcolumn" ></div>
                <div field="contactNo" width="60%" headerAlign="center" align="center" allowSort="true">手机号</div>    
                <div field="name" width="20%" headerAlign="center" align="center">姓名</div>                                            
                <div field="createTime" width="20%" headerAlign="center" align="center" dateFormat="yyyy-MM-dd" allowSort="true">创建日期</div>
            </div>
        </div>
    </div>                
    <div class="mini-toolbar" style="text-align:center;padding-top:8px;padding-bottom:8px;" borderStyle="border:0;">
        <a class="mini-button" style="width:60px;" onclick="onOk()">确定</a>
        <span style="display:inline-block;width:25px;"></span>
        <a class="mini-button" style="width:60px;" onclick="onCancel()">取消</a>
    </div>
    
<script type="text/javascript">
	mini.parse();
	var grid = mini.get("datagrid1");
	var customerId = mini.get("customer_id");
	function SetData(data) {
       //跨页面传递的数据对象，克隆后才可以安全使用
    	data = mini.clone(data);
    	customerId.setValue(data.id);
    }
	
 	function GetData() {
        var row = grid.getSelected();
        return row;
    }
    function search() {
        var phoneNum = mini.get("phoneNum").getValue();
        var name = mini.get("name").getValue();
        grid.load({id: customerId.getValue(), contactNo: phoneNum, name: name });
    }
    
    function onKeyEnter(e) {
        search();
    }
    
    function onRowDblClick(e) {
        onOk();
    }
	    
    function CloseWindow(action) {
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }

    function onOk() {
        CloseWindow("ok");
    }
    
    function onCancel() {
        CloseWindow("cancel");
    }
	    
</script>
</body>
</html>